Component({
    data: {
      selected: 0,
      color: "#333",
      usertype: '',
      selectedColor: "#E06E4C",
      allList: [{
        //stu
        list1: [{
            "iconPath": "../images/job/job.png",
            "selectedIconPath": "../images/job/job_active.png",
            "pagePath": "/pages/find_jobs/index/index",
            "text": "韶院职位"
          },{
            "iconPath": "../images/communicate/social.png",
            "selectedIconPath": "../images/communicate/social_active.png",
            "pagePath": "/pages/communicate/index/index",
            "text": "交流"
          }, {
            "iconPath": "../images/message/message.png",
            "selectedIconPath": "../images/message/message_active.png",
            "pagePath": "/pages/message/index/index",
            "text": "消息"
          },{
            "iconPath": "../images/me/profile.png",
            "selectedIconPath": "../images/me/profile_active.png",
            "pagePath": "/pages/me/index/index",
            "text": "我的"
          }],
        //hr
        list2: [{
            "iconPath": "../images/job/job.png",
            "selectedIconPath": "../images/job/job_active.png",
            "pagePath": "/pages/find_people/index/index",
            "text": "找人才"
        },{
            "iconPath": "../images/message/message.png",
            "selectedIconPath": "../images/message/message_active.png",
            "pagePath": "/pages/message/index/index",
            "text": "消息"
          },{
            "iconPath": "../images/me/profile.png",
            "selectedIconPath": "../images/me/profile_active.png",
            "pagePath": "/pages/me/index/index",
            "text": "我的"
          }],
        }],
      list: []
    },
    attached() {
      const usertype = wx.getStorageSync('user').userType
      if (usertype ==="stu") {
        this.setData({
          list: this.data.allList[0].list1
        })
      } else if (usertype ==="hr") {
        this.setData({
          list: this.data.allList[0].list2
        })
      }
    },
    methods: {
      switchTab(e) {
        const data = e.currentTarget.dataset
        const url = data.path
        wx.switchTab({ url })
        console.log(url);
        this.setData({
          selected: data.index
        })
      }
    },
  })
  